<?php
class Sequence extends SilkObjectRelationalMapping {
	public $table = 'sequences';
	public function __construct(){
		parent::__construct();
	}
    
	public function setup() {
	}
	
	public function get_next_sequence($params) {
		$seq = orm("Sequence")->find_by_name($params["name"]);
		$return_seq = $seq->sequence;
		$seq->sequence++;
		$seq->save();
		return $return_seq;
	}
}
?>